#include <bits/stdc++.h>
using namespace std;
int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (auto &x : a) cin >> x;
    reverse(a.begin(), a.end());
    for (auto x : a) cout << x << ' ';
    cout << endl;
  }
}
